﻿// =================================================================== 
// 数据访问层(GDIT.DAL)
//====================================================================
// 文件：DKeyWord.cs
// 项目名称：学院网站
// 创建时间：2012-08-08
// 负责人：ChenZhiGang
//引用DevExpress.Data.Filtering，DevExpress.Xpo程序集
// 程序集介绍：关键字信息数据访问层
// ===================================================================
using GDIT.Model;
using DevExpress.Data.Filtering;
using DevExpress.Xpo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GDIT.Pattern;

namespace GDIT.DAL
{
    public class DKeyWord : IKeyWord
    {
        //搜索相关的关键字，出现相应的文章显示
        private XpoHelper.Test<Mtb_BullentinKeyWord> userOperation = null;

        /// <summary>
        /// 查询并返回关键字集合
        /// </summary>
        /// <param name="word">需要查询的关键字</param>
        /// <returns></returns>
        public XPCollection SelectKeyWordByKeyWord(string word)
        {
            userOperation = new XpoHelper.Test<Mtb_BullentinKeyWord>();
            return userOperation.Operation("AritlceKeyWord", word);
        }

        /// <summary>
        /// 查询并返回关键字集合
        /// </summary>
        /// <param name="word">需要查询的关键字</param>
        /// <returns></returns>
        public XPCollection SelectCollegeKeyWord(string word)
        {
            XPCollection xp = new XPCollection(typeof(Mtb_CollegeKeyWord),new BinaryOperator("AritlceKeyWord",word));
            return xp;
        }
    }
}
